package and.tools;

import net.youmi.android.AdView;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.widget.FrameLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

public class ViewHelper {

	/*
	 * 获取一个分割线
	 */
	public static TextView getDivider(Context view, int height) {
		TextView tvDivider = new TextView(view);
		LayoutParams paramsDivider = new LayoutParams(LayoutParams.FILL_PARENT,
				height);
		tvDivider.setLayoutParams(paramsDivider);
		tvDivider
				.setBackgroundResource(android.R.drawable.divider_horizontal_dark);
		return tvDivider;
	}

	public static AdView getAdView(Activity ac) {

		AdView adView = new AdView(ac, Color.GRAY, Color.WHITE, 100);
		FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
				FrameLayout.LayoutParams.FILL_PARENT,
				FrameLayout.LayoutParams.WRAP_CONTENT);
		// 设置广告出现的位置(悬浮于底部)
		params.bottomMargin = 0;
		params.gravity = Gravity.BOTTOM;
		return adView;
	}

}
